package com.example.demo.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.crypto.interfaces.PBEKey;

/**
 * @author admin
 * @version 1.0 <br/>
 * <p style="font-family:SimSun;font-weight:bold">时间:<br/>2021/12/2 9:51</p>
 * @description
 */
@Controller
@RequestMapping("/order")
public class OrderController {
    @RequestMapping("/save")
    public String save(){
        Subject subject = SecurityUtils.getSubject();
        if(subject.hasRole("admin")){
            System.out.println("已进入访问");
            return "forward:/order.jsp";
        }else
            System.out.println("无权访问");
        return "redirect:/error.jsp";
    }
}
